package book;

import book.Book;

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class BookList {
    //数组初始容量
    private int MAX_SIZE = 10;
    //    //建立一个数组（书架），里面用来存放书
    private Book[] books;

    public int getUsedSize() {
        return usedSize;
    }

    public void setUsedSize(int usedSize) {
        this.usedSize = usedSize;
    }

    public void setBook(Book book, int pos) {
        this.books[pos] = book;
    }


    public Book getBook(int i) {
        return books[i];
    }

    public Book[] getBooks() {
        return books;
    }

    public void setBooks(Book[] books) {
        this.books = books;
    }
    //记录现在书架上书的数目
    private int usedSize;
    public BookList() {
        this.books = new Book[MAX_SIZE];
        this.books[0] = new Book("三国演义","罗贯中",25,"小说");
        this.books[1] = new Book("红楼梦","曹雪芹",56,"小说");
        this.books[2] = new Book("斗罗大陆","唐家三少",15,"小说");
        this.usedSize = 3;
    }

}
